package com.wuyou.designPatterns.observer;

/**
 * 以符号显示观察到的数值
 *
 * @Date 2024/10/15 17:26
 * @Author 无忧
 */

public class GraphObserver implements Observer{

    @Override
    public void update(NumberGenerator generator) {
        System.out.print("GraphObserver: ");
        int count = generator.getNumber();
        for(int i=0; i<count; i++){
            System.out.print("*");
        }
        System.out.println();
        try {
            Thread.sleep(100);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
    }
}
